/*
 ============================================================================
 Name        : ImgProc.c
 Author      :
 Version     :
 Copyright   : Your copyright notice
 Description :
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "IPFuncRes.h"
//#include "alloc.h"

int main() {

	int i = 0;

	do {
		i = menu(i);

		switch (i) {
		case 1:
			load_img();
			break;
		case 2:
			smoot(originalImage, edgeImage, bmpOutput);
			break;
		case 3:
			histograma(originalImage, vectorSize);
			break;
		case 4:
			oper_max(originalImage, edgeImage, bmpOutput);
			break;
		case 5:
			oper_med(originalImage, edgeImage, bmpOutput);
			break;
		case 6:
			oper_min(originalImage, edgeImage, bmpOutput);
			break;
		case 7:
			sobel(originalImage, edgeImage, bmpOutput);
			break;
		case 8:
			intensidade(originalImage, edgeImage, bmpOutput);
			break;
		case 9:
			copia(originalImage, edgeImage, bmpOutput);
			break;
		case 10:
			contraste(originalImage, edgeImage, bmpOutput);
			break;
		case 11:
			puts("Aplicando fclose() e free()...");
			fclose(bmpInput);
			fclose(bmpOutput);
			free(edgeImage.data); /* Finished with edgeImage.data */
			free(originalImage.data); /* Finished with originalImage.data */
			exit(0);
			break;
		default:
			puts("Not a valid option.");
			break;
		}
	} while (i != 8);
	return 0;
}

